package com.xcity.logupload;

import com.xcity.logupload.config.UploadType;
import com.xcity.logupload.task.UploadTaskFactory;

public class Main {

	public static void main(String[] args) {
		Resources.load();
//		System.out.println(Resources.getFtpConfig());
		
		final UploadType type = Enum.valueOf(UploadType.class, args[0].toUpperCase());
		
		new Thread() {
			@Override
			public void run() {
				try {
					UploadTaskFactory.create(type).upload();
				} catch (Exception e) {
					Resources.LOG.error(e.getMessage(), e);
				} finally {
					System.exit(0);
				}
			}
		}.start();
		
	}
	
	
}
